Enter two whole numbers to get their greatest common divisor (GCD) and least common multiple (LCM), with each step of the Euclidean algorith…
Find the GCD and LCM of two numbers, with the working shown
Enter two whole numbers of 1 or more and the tool finds their greatest common divisor (GCD) and least common multiple (LCM), showing the Euclidean algorithm line by line. Use it to reduce fractions, find common denominators, work out when two schedules with different cycles line up, or check math homework. Because the divisions are shown, not just the answer, you can compare each line with your own working.
The GCD comes from the Euclidean algorithm. Divide A by B, write the result as 'A = B × quotient + remainder', then repeat the same division with B and that remainder. The divisor at the moment the remainder hits 0 is the GCD. The LCM is then (A ÷ GCD) × B. For example, with A = 48 and B = 18 the three lines are 48 = 18 × 2 + 12, 18 = 12 × 1 + 6 and 12 = 6 × 2 + 0, so the GCD is 6 and the LCM is 48 ÷ 6 × 18 = 144. Putting the smaller number in A gives the same answer; you just get one extra first line, 18 = 48 × 0 + 18, which swaps the two.
Factoring gets slow as numbers grow, while the Euclidean algorithm needs only a few divisions. Even numbers near 100 million finish in a handful of lines, and it is faster by hand too.
Compute the result for the first two, then run it again with the third. gcd(a, b, c) = gcd(gcd(a, b), c), and the LCM works the same way.
This calculator accepts only whole numbers from 1 to 100,000,000. Zero, negatives and decimals just show the error message and nothing is calculated.
The product of the two numbers equals GCD × LCM. Once you have the GCD, the LCM takes one division, which is exactly how this tool computes it.
Posts · 0
No posts yet.